package org.wattdepot.cli.processor;

import java.util.List;
import org.wattdepot.cli.command.WattSources;

/**
 * Parses the sources command.
 * 
 * @author Kendyll Doi
 * @author Kimberly Heu
 *
 */
public class SourcesCommand extends CommandLineInterface implements WattDepotCliCommand {
  
  /**
   * Parses the sources command.
   * 
   * @param args The user's inputed arguments
   * @return The result of executing the command
   */
  public String doCommand (List<String> args) {
    StringBuffer buf = new StringBuffer(400); // Buffer to collect output
    String output = ""; // String to return
    
    // Check the number of commands given; should be exactly 1
    if (args.size() == 1) {
      buf.append(WattSources.wattSources(client));
    }
    else {
      buf.append("Incorrect number of arguments for sources command.");
    }
    
    output = buf.toString();
    return output;
  }
}
